﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SqlCe4Mvc3Application1.Models
{
    public partial class _Orchard_Blogs_BlogPartArchiveRecord : RaisingStudio.Data.Expressions.TableExpression, RaisingStudio.Data.Expressions.IQueryExpression<_Orchard_Blogs_BlogPartArchiveRecord>
    {
        #region Constructor (s) / Destructor
        /// <summary>
        /// Constructor (s) / Destructor.
        /// </summary>
        public _Orchard_Blogs_BlogPartArchiveRecord() : base("Orchard_Blogs_BlogPartArchiveRecord")
        {
        }
        #endregion
        #region Members
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Id = "Id";
        public RaisingStudio.Data.Expressions.ColumnExpression Id { get { return _Id; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Year = "Year";
        public RaisingStudio.Data.Expressions.ColumnExpression Year { get { return _Year; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Month = "Month";
        public RaisingStudio.Data.Expressions.ColumnExpression Month { get { return _Month; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _PostCount = "PostCount";
        public RaisingStudio.Data.Expressions.ColumnExpression PostCount { get { return _PostCount; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _BlogPart_id = "BlogPart_id";
        public RaisingStudio.Data.Expressions.ColumnExpression BlogPart_id { get { return _BlogPart_id; } }

		#endregion

        public static implicit operator RaisingStudio.Data.Expressions.ConditionExpression(_Orchard_Blogs_BlogPartArchiveRecord Orchard_Blogs_BlogPartArchiveRecord)
        {
            return new RaisingStudio.Data.Expressions.ConditionExpression();
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression)
        {
             RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
             return conditionExpression.OrderBy(columnExpression);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression, RaisingStudio.Data.Expressions.SortingDirection sortingDirection)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.OrderBy(columnExpression, sortingDirection);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression Where(RaisingStudio.Data.Expressions.ExpressionElement expressionElement)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.Where(expressionElement);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpressionCollection(_Orchard_Blogs_BlogPartArchiveRecord Orchard_Blogs_BlogPartArchiveRecord)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpressionCollection(Orchard_Blogs_BlogPartArchiveRecord);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpression[](_Orchard_Blogs_BlogPartArchiveRecord Orchard_Blogs_BlogPartArchiveRecord)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpression[]
                        {                            
                            Orchard_Blogs_BlogPartArchiveRecord.Id,
                            Orchard_Blogs_BlogPartArchiveRecord.Year,
                            Orchard_Blogs_BlogPartArchiveRecord.Month,
                            Orchard_Blogs_BlogPartArchiveRecord.PostCount,
                            Orchard_Blogs_BlogPartArchiveRecord.BlogPart_id,
                        };
        }

        public RaisingStudio.Data.Expressions.ColumnExpressionCollection Except(params RaisingStudio.Data.Expressions.ColumnExpression[] columns)
        {
            RaisingStudio.Data.Expressions.ColumnExpressionCollection columnExpressionCollection = this;
            return columnExpressionCollection.Except(columns);
        }

    
        public static implicit operator RaisingStudio.Data.Expressions.QueryExpression<_Orchard_Blogs_BlogPartArchiveRecord>(_Orchard_Blogs_BlogPartArchiveRecord Orchard_Blogs_BlogPartArchiveRecord)
        {
            return new RaisingStudio.Data.Expressions.QueryExpression<_Orchard_Blogs_BlogPartArchiveRecord>(Orchard_Blogs_BlogPartArchiveRecord);
        }


        #region IQueryExpression<_Orchard_Blogs_BlogPartArchiveRecord> 成员

        _Orchard_Blogs_BlogPartArchiveRecord RaisingStudio.Data.Expressions.IQueryExpression<_Orchard_Blogs_BlogPartArchiveRecord>.Value
        {
            get { return Orchard_Blogs_BlogPartArchiveRecord._; }
        }

        #endregion

        #region IQueryExpression 成员

        RaisingStudio.Data.Expressions.TableExpression RaisingStudio.Data.Expressions.IQueryExpression.Table
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ConditionExpression RaisingStudio.Data.Expressions.IQueryExpression.Condition
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ColumnExpressionCollection RaisingStudio.Data.Expressions.IQueryExpression.Columns
        {
            get { return null; }
        }

        #endregion
    }

    partial class Orchard_Blogs_BlogPartArchiveRecord
    {
        #region Members
        public static readonly _Orchard_Blogs_BlogPartArchiveRecord _ = new _Orchard_Blogs_BlogPartArchiveRecord();
		#endregion
    }
}
